var __extends =
    (this && this.__extends) ||
    (function () {
      var t = function (n, e) {
        return (t =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (t, n) {
              t.__proto__ = n;
            }) ||
          function (t, n) {
            for (var e in n)
              Object.prototype.hasOwnProperty.call(n, e) && (t[e] = n[e]);
          })(n, e);
      };
      return function (n, e) {
        function a() {
          this.constructor = n;
        }
        if ("function" != typeof e && null !== e)
          throw new TypeError(
            "Class extends value " + String(e) + " is not a constructor or null"
          );
        t(n, e),
          (n.prototype =
            null === e
              ? Object.create(e)
              : ((a.prototype = e.prototype), new a()));
      };
    })(),
  AXTalentPoolView = (function (t) {
    function n() {
      var n = t.call(this) || this;
      return (
        (n.onLoadTalentPoolDataFn = {
          caller: n,
          code: 1102,
          method: function (t) {
            (n.talentArr = []), (n.talentArr = t.list);
            for (var e, a = [], o = 0; o < t.list.length; o++)
              (e = {
                label_zxg_name: { text: t.list[o].name },
                label_zxg_attritu: { text: t.list[o].attr },
              }),
                a.push(e);
            n.list_zhaoxianguan.dataSource = a;
          },
        }),
        (n.onLoadTalentDetailDataFn = {
          caller: n,
          code: 1201,
          method: function (t) {
            AXTalentDetailDialog.showTalentDetailDialog(t.data);
          },
        }),
        n.btn_talentPool_cancle.on(Laya.Event.CLICK, n, n.onCancleFn),
        n.btn_zhaomufujiang.on(
          Laya.Event.CLICK,
          n,
          n.pnZhaoMuFuJiangDidClickFn
        ),
        n.btn_shujushuoming.on(
          Laya.Event.CLICK,
          n,
          n.pnFuJiangShuoMingDidClickFn
        ),
        n.tab_talent_touxian.on(
          Laya.Event.CLICK,
          n,
          n.onTabTalentTouXiangActionFn
        ),
        n.tab_talent_leixing.on(
          Laya.Event.CLICK,
          n,
          n.onTabTalentLeiXingActionFn
        ),
        WebSocketService.addListener(n.onLoadTalentPoolDataFn),
        (n.list_zhaoxianguan.renderHandler = new Laya.Handler(
          n,
          n.updateItemFn
        )),
        (n.list_zhaoxianguan.selectEnable = !0),
        (n.list_zhaoxianguan.vScrollBarSkin = ""),
        n.list_zhaoxianguan.on(
          Laya.Event.CLICK,
          n,
          n.onZhaoxianGuanDetailAction
        ),
        n
      );
    }
    return (
      __extends(n, t),
      (n.openView = function () {
        return (
          null == this.talenPoolVC && (this.talenPoolVC = new n()),
          (this.talenPoolVC.s_id = "4"),
          (this.talenPoolVC.t_id = "1"),
          this.talenPoolVC.loadZhaoXianGuanData(),
          (this.talenPoolVC.tab_talent_leixing.selectedIndex = 0),
          (this.talenPoolVC.tab_talent_touxian.selectedIndex = 0),
          this.talenPoolVC
        );
      }),
      (n.prototype.onTabTalentTouXiangActionFn = function (t) {
        var n = "1";
        "item0" == t.target.name
          ? (n = "4")
          : "item1" == t.target.name
          ? (n = "3")
          : "item2" == t.target.name
          ? (n = "2")
          : "item3" == t.target.name && (n = "1"),
          (this.s_id = n),
          this.loadZhaoXianGuanData();
      }),
      (n.prototype.onTabTalentLeiXingActionFn = function (t) {
        var n = "1";
        "item0" == t.target.name
          ? (n = "1")
          : "item1" == t.target.name
          ? (n = "2")
          : "item2" == t.target.name
          ? (n = "3")
          : "item3" == t.target.name
          ? (n = "4")
          : "item4" == t.target.name && (n = "5"),
          (this.t_id = n),
          this.loadZhaoXianGuanData();
      }),
      (n.prototype.updateItemFn = function (t, n) {
        var e = (n + 1) / 50;
        1 == this.list_zhaoxianguan.selectedIndex &&
          e >= 1 &&
          WebSocketService.send({
            c: 1102,
            d: { s: this.s_id, t: this.t_id, pageNum: e },
          });
      }),
      (n.prototype.loadZhaoXianGuanData = function () {
        WebSocketService.send({
          c: 1102,
          d: { s: this.s_id, t: this.t_id, pageNum: 0 },
        });
      }),
      (n.prototype.onZhaoxianGuanDetailAction = function (t) {
        if ("" != t.target.name) {
          var n = this.talentArr[this.list_zhaoxianguan.selectedIndex].id;
          WebSocketService.send({ c: 1201, d: { id: n } }),
            WebSocketService.addListener(this.onLoadTalentDetailDataFn);
        }
      }),
      (n.prototype.pnZhaoMuFuJiangDidClickFn = function () {
        AXRecruitmentDialog.showRecruitmentOpen("1");
      }),
      (n.prototype.pnFuJiangShuoMingDidClickFn = function () {
        AXRecruitmentDialog.showRecruitmentOpen("2");
      }),
      (n.prototype.onCancleFn = function () {
        this.removeSelf();
      }),
      n
    );
  })(ui.SubSquareController.AXTalentPoolViewUI);
